package cn.tedu.charging.user.controller;

import cn.tedu.charging.user.vo.UserInfoVO;
import cn.tedu.charging.common.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@Slf4j
@RequestMapping("/user")
@RestController
@Api(tags = "用户相关接口")
public class UserController {
    @ApiOperation("获取用户信息")
    @GetMapping("/info/{userId}")
    public JsonResult getUserInfo(@PathVariable ("userId") Long userId){
        log.debug("获取用户信息-{}",userId);
        UserInfoVO vo = new UserInfoVO();
        vo.setCarId(11);
        return JsonResult.ok(vo);

    }

    @ApiOperation("获取用户余额")
    @GetMapping("/balance/{userId}")
    public JsonResult getUserBalance(@PathVariable ("userId") Long userId){
        log.debug("获取用户余额-{}",userId);
        BigDecimal balance = new BigDecimal(100000);
        return JsonResult.ok(balance);

    }
}
